from models import Subject
import os

subjects = [s.name for s in Subject.query.all()]
print(subjects)

#创建学科的目录
def mkdir_subject(base_dir, subjects):
    for sub in subjects:
        dir_name = os.path.join(base_dir, sub)
        if not os.path.exists(dir_name):
            os.mkdir(os.path.join(base_dir, sub))

base_dir = 'data/fill_data/subject/'
mkdir_subject(base_dir, subjects)
